var a, o = require("../../../utils/util.js"), t = getApp().globalData.url;

Page({
    data: {
        domain: t
    },
    onLoad: function(t) {
        if (a = this, void 0 !== t.id) if (1 == t.click) a.setData({
            lat: t.lat,
            lng: t.lng,
            shopName: t.shopName,
            shopAddr: t.shopAddr,
            shopId: t.id
        }); else {
            var s = t.lat + "," + t.lng;
            o.transformatLat({
                locations: s,
                type: 3,
                key: "HVLBZ-Q24C2-CO6U2-C3AUW-EH4E6-D3F6X"
            }, function(o) {
                "转换成功" == o.message ? a.setData({
                    lat: o.locations[0].lat,
                    lng: o.locations[0].lng,
                    shopName: t.shopName,
                    shopAddr: t.shopAddr,
                    shopId: t.id
                }) : a.setData({
                    lat: parseInt(t.lat),
                    lng: parseInt(t.lng),
                    shopName: t.shopName,
                    shopAddr: t.shopAddr,
                    shopId: t.id
                });
            }, function(a) {});
        }
    },
    onReady: function() {},
    onShow: function() {},
    open_location: function(o) {
        var t = a.data;
        wx.openLocation({
            latitude: parseFloat(t.lat),
            longitude: parseFloat(t.lng),
            scale: 18,
            name: t.shopName,
            address: t.shopAddr
        });
    }
});